package com.zsrt.java.ex.proxy.demo02;


/**
 * 代理对象（静态代理）
 * 	代理对象，要实现与目标对象一样的接口
 * @author My
 *
 */
public class UserDaoProxy implements IUserDao {
	
	
	private IUserDao target;
	public UserDaoProxy(IUserDao target){
		this.target=target;
		
	}

	@Override
	public void save() {
		
		System.out.println("开启事务");
		
		target.save();
		
		System.out.println("提交事务");
		
	}
	

}
